package com.clinic.entity.gui;

import org.apache.commons.lang.xwork.StringUtils;

import com.clinic.entity.type.UserType;


public class GuiUser {
	
	private long userId;
	private String name;
	private String type;
	private boolean admin;
	private GuiUserContact contact;
	
	public boolean isAvailable() {
		return (userId > 0 && StringUtils.isNotBlank(name) && StringUtils.isNotBlank(type));
	} 
	
	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public UserType getUserType() {
		return UserType.getValue(getType());
	}
	
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	public boolean isAdmin() {
		return admin;
	}

	public void setAdmin(boolean admin) {
		this.admin = admin;
	}

	public GuiUserContact getContact() {
		return contact;
	}

	public void setContact(GuiUserContact contact) {
		this.contact = contact;
	}

}
